package com.weight.common.generate.temple;

import com.weight.common.generate.base.ResourceFile;


/**
* 
*  
*/
public class MybatisConfigFile extends ResourceFile {
	private static final String FILE_NAME = ".xml";
	
//	protected String fileDir;// 文件路径
//	protected String fileName;//文件名
//	protected String resource;//文件內容
	
	public MybatisConfigFile(String filePath,String model,String fileName,String packPath,String tableCnName) {
		
		super(filePath,new StringBuilder(fileName).append(FILE_NAME).toString());
		String projectName=getModelClass( model).toString();
		
		StringBuilder  resourceFile =new StringBuilder();
		resourceFile.append("\t\t<!-- ").append(tableCnName).append("-->\n");
		resourceFile.append("\t\t<typeAlias alias=\"").append(projectName).append("\" type=\"")
		.append(packPath).append(".PO.").append(projectName).append("\"/>\n");
		
		String resource = resourceFile.toString();
		init(resource);
	}
}
